/************************************************************************
**	Use the mouse QCursor shape to identify the action.
**	The QCursor shape will be the a state of the object.
**	Besides general actions provided by Qt, 
**	here, just add arrow is need to be specialized.
*************************************************************************/

#ifndef GRAPHICSSCENE_H
#define GRAPHICSSCENE_H

#include <QGraphicsScene>
class QGraphicsSvgItem;
class GActiveElement;
class Link;

class APnMScene : public QGraphicsScene
{
	Q_OBJECT

public:
	APnMScene(QObject *parent);
	~APnMScene();

signals:
	void addLink(Link * newLink);

protected:
	void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent);
	void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent);

private:
	QGraphicsSvgItem* mHitPort;
	GActiveElement* mStartElement;
	//mHitPort's direction, serve for calculating path of link
	QString mDirection;
	QPointF mOrigin; //path origin
	QGraphicsPathItem *mPathItem; //Rubber Band Technology
};

#endif // GRAPHICSSCENE_H
